package jam4j;

import jam4j.util.FallibleThunk;

import java.io.File;
import java.util.List;
import java.util.Set;

public interface TargetDef {
    String name();
    Set<Flag> flags();
    void addFlag(Flag flag);
    
    List<? extends TargetDef> dependencies();
    TargetDef includeTarget();
    
    <T, X extends Throwable> T runInScope(FallibleThunk<T, X> thunk) throws X;
    void scanForHeaders(File boundFile);
    
    /**
     * One of various flags that can be set on a target. Most correspond to a
     * builtin rule.
     * 
     * @author Luke Maurer
     */
    public enum Flag {
        /** Marked TEMPORARY */
        TEMP,
        /** Marked NOCARE */
        NOCARE,
        /** Marked NOTFILE */
        NOTFILE,
        /** Marked ALWAYS or touched by option */
        TOUCHED,
        /** Marked LEAVES */
        LEAVES,
        /** Marked NOUPDATE */
        NOUPDATE,
        /** Internal target for INCLUDEs of another target */
        INTERNAL
    }
}
